﻿Imports System.ComponentModel

Public Class LiveProgram
    Inherits NotifyPropertyChangedBase

    'Public Sub New(ByVal id As String)
    '    Me.Id = id
    'End Sub

    Private _id As String = ""
    Public Property Id() As String
        Get
            Return _id
        End Get
        Set(ByVal value As String)
            _id = value
            OnPropertyChanged("Id")
        End Set
    End Property

    Private _isAlerted As Boolean
    Public Property IsAlerted() As Boolean
        Get
            Return _isAlerted
        End Get
        Set(ByVal value As Boolean)
            _isAlerted = value
            OnPropertyChanged("IsAlerted")
        End Set
    End Property

    Private _caster As String = ""
    Public Property Caster() As String
        Get
            Return _caster
        End Get
        Set(ByVal value As String)
            _caster = value
            OnPropertyChanged("Caster")
        End Set
    End Property

    Private _station As Station
    Public Property Station() As Station
        Get
            Return _station
        End Get
        Set(ByVal value As Station)
            _station = value
            OnPropertyChanged("Station")
        End Set
    End Property

    Private _title As String = ""
    Public Property Title() As String
        Get
            Return _title
        End Get
        Set(ByVal value As String)
            _title = value
            OnPropertyChanged("Title")
        End Set
    End Property

    Private _content As String = ""
    Public Property Content() As String
        Get
            Return _content
        End Get
        Set(ByVal value As String)
            _content = value
            OnPropertyChanged("Content")
        End Set
    End Property

    Private _hasFullContent As Boolean
    Public Property HasFullContent() As Boolean
        Get
            Return _hasFullContent
        End Get
        Set(ByVal value As Boolean)
            _hasFullContent = value
        End Set
    End Property

    Public ReadOnly Property Uri() As Uri
        Get
            Return New Uri(String.Format(My.Settings.LiveProgramUriFormat, Me.Id))
        End Get
    End Property

    Private _startDateTime As DateTime
    Public Property StartDateTime() As DateTime
        Get
            Return _startDateTime
        End Get
        Set(ByVal value As DateTime)
            _startDateTime = value
            OnPropertyChanged("StartDateTime")
        End Set
    End Property

    Private _visitorCount As Integer
    Public Property VisitorCount() As Integer
        Get
            Return _visitorCount
        End Get
        Set(ByVal value As Integer)
            _visitorCount = value
            OnPropertyChanged("VisitorCount")
            'OnPropertyChanged("VisitorCountPerMinute")
        End Set
    End Property

    Private _commentCount As Integer
    Public Property CommentCount() As Integer
        Get
            Return _commentCount
        End Get
        Set(ByVal value As Integer)
            _commentCount = value
            OnPropertyChanged("CommentCount")
            'OnPropertyChanged("CommentCountPerMinute")
        End Set
    End Property

    Private _isMemberOnly As Boolean
    Public Property IsMemberOnly() As Boolean
        Get
            Return _isMemberOnly
        End Get
        Set(ByVal value As Boolean)
            _isMemberOnly = value
            OnPropertyChanged("IsMemberOnly")
        End Set
    End Property

    Private _crawlDateTime As DateTime
    Public Property CrawlDateTime() As DateTime
        Get
            Return _crawlDateTime
        End Get
        Set(ByVal value As DateTime)
            _crawlDateTime = value
            OnPropertyChanged("CrawlDateTime")
        End Set
    End Property



    'Public Property CommentCountPerMinute() As Integer
    '    Get
    '        Dim m = CrawlDateTime.Subtract(Me.StartDateTime).TotalMinutes
    '        If m > 0 Then
    '            Return CInt(Me.CommentCount / m)
    '        Else
    '            Return 0
    '        End If
    '    End Get
    '    Set(ByVal value As Integer)
    '        'FirePropertyChanged("CommentCountPerMinute")
    '    End Set
    'End Property

    'Public Property VisitorCountPerMinute() As Integer
    '    Get
    '        Dim m = CrawlDateTime.Subtract(Me.StartDateTime).TotalMinutes
    '        If m > 0 Then
    '            Return CInt(Me.VisitorCount / m)
    '        Else
    '            Return 0
    '        End If
    '    End Get
    '    Set(ByVal value As Integer)
    '        'FirePropertyChanged("VisitorCountPerMinute")
    '    End Set
    'End Property

    Private _category As String = ""
    Public Property Category() As String
        Get
            Return _category
        End Get
        Set(ByVal value As String)
            _category = value
            OnPropertyChanged("Category")
        End Set
    End Property

    Private _isFace As Boolean
    Public Property IsFace() As Boolean
        Get
            Return _isFace
        End Get
        Set(ByVal value As Boolean)
            _isFace = value
            OnPropertyChanged("IsFace")
        End Set
    End Property
End Class
